<html>
<head>
<title>Normal Order</title>
<style type="text/css">
body {
	font-family:verdana,arial,sans-serif;
	font-size:10pt;
	margin:30px;
	background-color:#ffcc00;
	}
</style>
</head>
<body>
<h1>Make a Normal Order</h1>
<br />
<form name= "addorder" action="normalorderbook_action.php" method="post">

<?php
$username="bsc353_4";
$password="sonbeans";
$database="bsc353_4";

mysql_connect("clipper.encs.concordia.ca",$username,$password) or die ("Unable to connect to database");

@mysql_select_db($database) or die ("Unable to select database");
$ISBNquery= "Select title, ISBN from Book";
$allISBN=mysql_query($ISBNquery);
$numISBN= mysql_numrows($allISBN);


mysql_close();

echo"<p>Select ISBN: ";
echo"<select name='ISBN'>";
echo"<option>Select One</option>";
$i=0;
while($i<$numISBN)
    {
    $value=mysql_result($allISBN,$i,"ISBN");
    $title = mysql_result($allISBN, $i, "title");
  
    $string = sprintf("%-20s %s", $title, $value);
    echo "<option value =$value> $string</option>";
    ++$i;
    }   
echo"</select></p>";

?>
<p>Quantity to Order: <input type="text" name="quantity" value = "1"></p>
<?php
$username="bsc353_4";
$password="sonbeans";
$database="bsc353_4";

mysql_connect("clipper.encs.concordia.ca",$username,$password) or die ("Unable to connect to database");

@mysql_select_db($database) or die ("Unable to select database");
$publisherquery= "Select distinct name from Publisher";
$allpub=mysql_query($publisherquery) or die ("Query did not work");
$numpub= mysql_numrows($allpub);

mysql_close();




//echo"<p>Select Publisher: ";
//echo"<select name='publisher'>";
//echo"<option>Select One</option>";
//$i=0;
//while($i<$numpub)
//    {
//    $value=mysql_result($allpub,$i,"name");
//    echo "<option>$value</option>";
//    ++$i;
//    }   
//echo"</select></p>";


?>
<p>Select the Branch of the publisher to order from:
       <select name='branch'>
            <option>Select One</option>
            <option>East</option>
            <option>West</option>
            <option>South</option>
            <option>North</option>
       </select></p>

<input type="submit" value="Place Order">

</form> 


</body>
</html>